<!DOCTYPE html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>${APP.name!'简单开发平台'}-登录</title>
    <link href="/ui/login/styles.css" rel="stylesheet"/>
    <link href="/ui/login/jquery-ui-1.8.16.custom.css" rel="stylesheet">
    <script src="/ui/js/jquery.min.js"></script>
    <script src="/ui/login/jquery-ui-1.8.16.custom.min.js"></script>
</head>
<script type="text/javascript">

    // 禁止登录页内嵌
    if (window != top) {
        parent.location.href = location.href;
    }

    var UA = navigator.userAgent.toLowerCase();
    var browerKernel = {
        isWebkit: function () {
            if (/webkit/i.test(UA))
                return true;
            else
                return false;
        },
        isFirefox: function () {
            if (/firefox/i.test(UA))
                return true;
            else
                return false;
        }
    }

    if (!browerKernel.isWebkit()) {
        alert("您当前浏览器无法兼容本系统！\n推荐使用Google Chrome 浏览器！\n\n其它兼容浏览器：\n360浏览器极速模式\n搜狗高速浏览器3\n世界之窗极速版\n猎豹浏览器\nQQ浏览器\n其它浏览器请自测");
    }

    $(function () {
        $('form :input:first').focus();
        $('form :input').keyup(function (event) {
            if (event.keyCode == 13) {
                $('#loginForm').submit();
            }
        });
    });

</script>
<body id="login">
<div class="fixed-bg" style="background-image: url(/ui/login/big.png); background-size: cover;"></div>
<div id="wrappertop"></div>
<div id="wrapper">
    <div id="content">
        <div id="header" style="height: 51px;">
            <img src="${APP.logo!'/ui/images/logo.png'}" alt="EOVA">
        </div>
        <div id="darkbanner" class="banner320">
            <h2 style='font-family: "Microsoft YaHei"'>${APP.name!'简单开发平台'} ┇ 用户登录</h2>
        </div>
        <div id="darkbannerwrap"></div>
        <form id="loginForm" method="post" action="/doLogin">
            <fieldset class="form">
                <p>
                    <label class="loginlabel" for="user_name"> 帐号:</label> <input
                        class="logininput ui-keyboard-input ui-widget-content ui-corner-all"
                        name="loginId" id="user_name" type="text"
                        value="${login_id!}"/>
                </p>
                <p>
                    <label class="loginlabel" for="user_password"> 密码:</label> <span>
							<input class="logininput ui-keyboard-input ui-widget-content ui-corner-all" name="loginPwd"
                                   value="${login_pwd!}" id="user_password" type="password"/>
						</span>
                </p>
                <%if(isTrue(isCaptcha!)){%>
                <p>
                    <label class="loginlabel" for="captcha"> 验证码:</label>
                    <input class="logininput ui-keyboard-input ui-widget-content ui-corner-all" name="captcha"
                           id="captcha" type="text" value="" style="width: 75px;" maxlength="4"/>
                    <img src="/captcha" height="27" onclick="this.src='/captcha?'+Math.random()"
                         style="cursor:pointer;vertical-align: middle;"/>
                </p>
                <%}%>
                <div style="text-align: left; margin-left: 80px; margin-bottom: 5px; color: #BE1302;">
                    <b>${msg!}</b>
                </div>
                <div>
                    <button id="loginbtn" type="button" class="positive" name="Submit">
                        <img src="/ui/login/key.png"/>快速登录
                    </button>
                </div>
            </fieldset>
        </form>
    </div>
    <div id="wrapperbottom_branding_text">
        ${APP.copyright!}
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".logininput").blur(function () {
            if ($(this).val() == "") {
                $(this).css("border-color", "red");
            } else {
                $(this).css("border-color", "#D9D6C4");
            }
        })

        $("#loginbtn").click(function () {
            var k = 0;
            var ajaxhtml = "";
            $(".logininput").each(function (i, obj) {
                if ($(obj).val().trim() == "") {
                    k++;
                    $(this).css("border-color", "red");
                    $(this).focus();
                    return false;
                }
            });
            if (k != 0)
                return;
            ajaxhtml = $("#loginbtn").html();
            $("#loginbtn").html("Loading....");
            $("#loginbtn").attr("disabled", "disabled");
            $("#loginForm").submit();
        })
    });
</script>
</body>
</html>